package com.totoro.service.impl;

import com.totoro.mapper.ProductMapper;
import com.totoro.mapper.SellerMapper;
import com.totoro.pojo.*;
import com.totoro.service.SellerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author TOTORO
 * @date 2021/7/19 15:57
 */
@Service
public class SellerServiceImpl implements SellerService {

    @Autowired
    SellerMapper sellerMapper;
    @Autowired
    ProductMapper productMapper;

    @Override
    public User findUserBySlid(int slid) {
        return sellerMapper.findUserBySlid(slid);
    }

    @Override
    public User findUserByUid(int uid) {
        return sellerMapper.findUserByUid(uid);
    }

    @Override
    public Seller findSellerIdByUserId(int uid) {
        return sellerMapper.findSellerIdByUserId(uid);
    }

    @Override
    public Seller findSellerBySlid(int slid) {
        return sellerMapper.findSellerBySlid(slid);
    }

    @Override
    public Integer updateSellerScore(int score, int slid) {
        return sellerMapper.updateSellerScore(score, slid);
    }

    @Override
    public List<Product> directFindSellerBuyBaby(int slid) {
        return sellerMapper.directFindSellerBuyBaby(slid);
    }

    @Override
    public List<Product> termFindSellerBuyBaby(BuyProductTerm buyProductTerm) {
        return sellerMapper.termFindSellerBuyBaby(buyProductTerm);
    }

    @Override
    public Integer updateProductName(int productId, String productName, int itMethod) {
        return productMapper.updateProductName(productId, productName, itMethod);
    }

    @Override
    public List<Product> termFindSellerDeleteBaby(BuyProductTerm buyProductTerm) {
        return sellerMapper.termFindSellerDeleteBaby(buyProductTerm);
    }

    @Override
    public CreditLevel findCreditLevelByCreditScore(int creditScore) {
        return sellerMapper.findCreditLevelByCreditScore(creditScore);
    }

    @Override
    public Integer findNextLevelDifferCreditScore(CreditLevel creditLevel) {
        return sellerMapper.findNextLevelDifferCreditScore(creditLevel);
    }

    @Override
    public Integer addApplySeller(int uid, String shopName) {
        return sellerMapper.addApplySeller(uid, shopName);
    }

    @Override
    public ApplySeller findUserApplySellerStatus(int uid) {
        return sellerMapper.findUserApplySellerStatus(uid);
    }

    @Override
    public Integer deleteApplySeller(int uid) {
        return sellerMapper.deleteApplySeller(uid);
    }

    @Override
    public Integer updateShopPrimaryInfo(Shop shop) {
        return sellerMapper.updateShopPrimaryInfo(shop);
    }

    @Override
    public Integer updateShopHeadByShopId(int shopId, String shopHead) {
        return sellerMapper.updateShopHeadByShopId(shopId, shopHead);
    }

    @Override
    public Integer updateShopPrimaryImage(int shopId, String shopImage) {
        return sellerMapper.updateShopPrimaryImage(shopId, shopImage);
    }

    @Override
    public Integer updateShopCategoryBackgroundColor(int shopId, String color) {
        return sellerMapper.updateShopCategoryBackgroundColor(shopId, color);
    }

    @Override
    public Integer updateShopCategoryForegroundColor(int shopId, String color) {
        return sellerMapper.updateShopCategoryForegroundColor(shopId, color);
    }

    @Override
    public Integer addShopSwitchImage(ShopSwitchImage shopSwitchImage) {
        return sellerMapper.addShopSwitchImage(shopSwitchImage);
    }

    @Override
    public Integer deleteShopSwitchImage(ShopSwitchImage shopSwitchImage) {
        return sellerMapper.deleteShopSwitchImage(shopSwitchImage);
    }
}
